<style>
.label-default {
    background-color: #f5f7fb;
	color: #999;
}
</style>
<div class="fui-page" ng-if="pagedata.op == 'list'">
	<div id="tab" class="fui-tab fui-tab-danger" style="top:0">
        <a class="external {{pagedata.params.status == 0?'active':''}}" href="javascript:" ng-click="pagedata.params.status=0;tool.get_list('jy_51job/merch.gong/list/',true)">待签</a>
        <a class="external {{pagedata.params.status == 1?'active':''}}" href="javascript:" ng-click="pagedata.params.status=1;tool.get_list('jy_51job/merch.gong/list/',true)">待入职</a>
        <a class="external {{pagedata.params.status == 2?'active':''}}" href="javascript:" ng-click="pagedata.params.status=2;tool.get_list('jy_51job/merch.gong/list/',true)">进行中</a>
        <a class="external {{pagedata.params.status == 3?'active':''}}" href="javascript:" ng-click="pagedata.params.status=3;tool.get_list('jy_51job/merch.gong/list/',true)">已完成</a>
    </div>
	<div class='fui-content'>
	<div class='jy-content'>
	<div class="fui-cell-group radius" ng-repeat="item in pagedata.list">
		<div class="fui-cellone" style="background:#fff;padding:0.5rem">
				<div class="fui-cellone-label"style="width:auto;padding-right:1rem;font-size:0.8rem">
					[{{item.typetitle}}]{{item.member.usename}}
				</div>
				<div class="fui-cellone-info" style="text-align:right"></div>
				<div class="fui-cellone-remark">
					{{item.statustitle}}
				 </div>
		</div>
		<div class="fui-cell" style="background:#fff;padding:0.5rem;align-items:stretch">
				<div class="fui-cell-text" style="line-height:1.8">
					<div>{{item.jobinfo.title}}</div>
					<div>
						<span ng-if="item.day" class="label label-default">{{item.day}}入职</span>
						<span class="label label-default">{{item.onlinetime.start}}~{{item.onlinetime.end}}</span>
						<span class="label label-default">{{item.baotypetitle}}</span>
					</div>
					<div class="gray" style="font-size:0.65rem">
						<span class="syscolor" ng-if="item.city">{{item.city}}</span>
					</div>
					<div>
						<span ng-if="item.isxieyiuser == 1" class="label label-info">客户已签协议</span>
						<span ng-if="item.ishetonguser == 1" class="label label-info">客户已签合同</span>
					</div>
				</div>
				<div class="fui-cellone-remark noremark">
					<span class="bold syscolor" style="font-size:0.9rem">{{item.pay}}</span>
				 </div>
		</div>
		<div ng-show="item.status == 2" class="fui-cell" style="background:#fff;padding:0.5rem;padding-top:0;">
				<div class="fui-cell-text" style="line-height:1.8">
					<div><i class="icon icon-phone" href="tel:{{item.member.mobile}}"> {{item.member.mobile}}</i></div>
					<div class="gray" style="font-size:0.65rem">
						最近打卡时间：{{item.signlog.starttime2||item.signlog.endtime2}}
					</div>
					<div class="gray" style="font-size:0.65rem">
						最近打卡地：{{item.signlog.address}}
					</div>
					<div class="gray" style="font-size:0.65rem">
						最近轨迹地：{{item.maplog.address}}
					</div>
				</div>
				<div class="fui-cellone-remark noremark">
					<span class="btn btn-sm btn-danger-o order-finish" href="javascript:" ng-click="access_json('/maplog//id='+item.signlog.id)">查岗</span>
				 </div>
		</div>
		<div class="r" style="padding:0.5rem">
			<span ng-show="item.isxieyi == 0" class="btn btn-sm btn-default-o order-finish" href="javascript:" ng-click="pagedata.toxieyi(item)">签协议</span>
			<span ng-show="item.ishetong == 0 && item.ishetonguser==1 && item.isxieyi == 1" class="btn btn-sm btn-danger-o order-finish" href="javascript:" ng-click="pagedata.tohetong(item)">签合同</span>
			<span ng-show="item.status == 1" class="btn btn-sm btn-default-o order-finish" href="javascript:" ng-click="pagedata.nowitem=item;pagedata.showstatus2=true">办入职</span>
			<span ng-show="item.status == 2" class="btn btn-sm btn-default-o order-finish" href="javascript:" ng-click="pagedata.nowitem=item;pagedata.showupinfo=true">岗位设置</span>
			<span ng-show="item.status == 2" class="btn btn-sm btn-danger-o order-finish" href="javascript:" ng-click="pagedata.nowitem=item;pagedata.showstatus3=true">办离职</span>
        </div>
	</div>
	</div>
	<div class="content-empty" ng-show="!pagedata.list || pagedata.list.length == 0 ">
		  <i class="icon jinyunicon icon-cry" style="width: 6rem;margin-bottom: 0.5rem;"></i><br/><p style="color: #999;font-size: .75rem">您暂时没有应聘！</p>
	</div>
	<div ng-include="sys_html('common/_copyright',true)"></div>
	</div>
</div>
<div ng-if="pagedata.show_xieyi" class="popup">
	<div class="popup-body">
		<div class="popup-center">
			<i class="closed icon icon-cuowu" ng-click="pagedata.show_xieyi=false"></i>
			<div class="content-images" style="padding:0.5rem;height:20rem; overflow-y:scroll;">
					<div class="title bold" style="font-size:0.8rem">[预览]{{pagedata.xieyi.title || '客户协议'}} / <small>Read Ggree</small></div>
					<div class="text" style="padding-top:0.5rem;font-size:0.7rem" ng-bind-html="trust(pagedata.xieyi.content)">
					</div>
			</div>
			<div class="modal-footer">
				<div ng-click="pagedata.show_xieyi=false;post({},'/gong/postxieyi/ismerch=1&gongid='+pagedata.nowitem.id+'&xieyiid='+pagedata.xieyi.id)" class="mod-check" style="width: 100%; margin: 0;">前往签署</div>
			</div>
		</div>
	</div>
</div>
<div ng-if="pagedata.show_hetong" class="popup">
	<div class="popup-body">
		<div class="popup-center">
			<i class="closed icon icon-cuowu" ng-click="pagedata.show_hetong=false"></i>
			<div class="content-images" style="padding:0.5rem;height:20rem; overflow-y:scroll;">
					<div class="title bold" style="font-size:0.8rem">[预览]{{pagedata.hetong.title || '客户合同'}} / <small>Read Ggree</small></div>
					<div class="text" style="padding-top:0.5rem;font-size:0.7rem">
						<img ng-repeat="img in pagedata.hetong.images" style="width:100%" src="{{img}}">
					</div>
			</div>
			<div class="modal-footer">
				<div ng-click="pagedata.show_hetong=false;post({},'/gong/posthetong/ismerch=1&gongid='+pagedata.nowitem.id+'&hetongid='+pagedata.hetong.id)" class="mod-check" style="width: 100%; margin: 0;">前往签署</div>
			</div>
		</div>
	</div>
</div>
<div ng-if="pagedata.showstatus2" class="popup">
	<div class="popup-body">
		<div class="popup-center">
			<i class="closed icon icon-cuowu" ng-click="pagedata.showstatus2=false"></i>
			<div class="content-images" style="padding:0.5rem;height:20rem; overflow-y:scroll;">
					<div class="title bold" style="font-size:0.8rem">【{{pagedata.nowitem.member.usename}}】办入职</div>
					<div class="fui-cell-group">
					<div class="fui-cell">
						<div class="fui-cell-label" style="width:auto">入职日期</div>
						<div class="fui-cell-info"><input type="date" value="{{pagedata.nowitem.day}}" class='fui-input' placeholder="" ng-model="pagedata.nowitem.day" /></div>
					</div>
					</div>
			</div>
			<div class="modal-footer">
				<div ng-click="pagedata.showstatus2=false;post(pagedata.nowitem,'/merch.gong/status2/')" class="mod-check" style="width: 100%; margin: 0;">提交入职</div>
			</div>
		</div>
	</div>
</div>
<div ng-if="pagedata.showstatus3" class="popup">
	<div class="popup-body">
		<div class="popup-center">
			<i class="closed icon icon-cuowu" ng-click="pagedata.showstatus3=false"></i>
			<div class="content-images" style="padding:0.5rem;height:20rem; overflow-y:scroll;">
					<div class="title bold" style="font-size:0.8rem">【{{pagedata.nowitem.member.usename}}】办离职</div>
					<div class="fui-cell-group">
					<div class="fui-cell">
						<div class="fui-cell-label" style="width:auto">离职日期</div>
						<div class="fui-cell-info"><input type="date" value="{{pagedata.nowitem.endday}}" class='fui-input' placeholder="" ng-model="pagedata.nowitem.endday" /></div>
					</div>
					</div>
			</div>
			<div class="modal-footer">
				<div ng-click="pagedata.showstatus3=false;post(pagedata.nowitem,'/merch.gong/status3/')" class="mod-check" style="width: 100%; margin: 0;">提交离职</div>
			</div>
		</div>
	</div>
</div>
<div ng-if="pagedata.showupinfo" class="popup">
	<div class="popup-body">
		<div class="popup-center">
			<i class="closed icon icon-cuowu" ng-click="pagedata.showupinfo=false"></i>
			<div style="padding:0.5rem;height:20rem; overflow-y:scroll;">
					<div class="title bold" style="font-size:0.8rem">【{{pagedata.nowitem.member.usename}}】岗位设置</div>
					<div class="fui-cell-group">
						<div class="fui-cell">
							<div class="fui-cell-label" style="width:auto">打卡城市</div>
							<div class="fui-cell-info" style="padding:0.2rem;border: 1px solid #D9D9D9;">
									<select class="fui-input" style="margin-left:0" ng-model="pagedata.nowitem.pcd.province"  ng-change="pagedata.nowitem.pcd.city=undefined;pagedata.nowitem.pcd.district=undefined;pagedata.nowitem.pcd.street=undefined">
										<option value="" selected="selected">省份</option>
										<option ng-repeat="(value,data) in pagedata.areas" ng-selected="pagedata.nowitem.pcd.province==value"  value="{{value}}">{{value}}</option>
									</select>
								</div>
								<div class="fui-cell-info" style="padding:0.2rem;border: 1px solid #D9D9D9;">
									<select class="fui-input" style="margin-left:0" ng-model="pagedata.nowitem.pcd.city" ng-change="pagedata.nowitem.pcd.district=undefined;pagedata.nowitem.pcd.street=undefined">
										<option value="" selected="selected">城市</option>
										<option ng-repeat="(value,data) in pagedata.areas[pagedata.nowitem.pcd.province]" ng-selected="pagedata.nowitem.pcd.city==value" value="{{value}}">{{value}}</option>
									</select>
								</div>
								<div class="fui-cell-info" style="padding:0.2rem;border: 1px solid #D9D9D9;">
									<select class="fui-input" style="margin-left:0" ng-model="pagedata.nowitem.pcd.district" ng-change="pagedata.nowitem.pcd.street=undefined">
										<option value="" selected="selected">区县</option>
										<option ng-repeat="(value,data) in pagedata.areas[pagedata.nowitem.pcd.province][pagedata.nowitem.pcd.city]" ng-selected="pagedata.nowitem.pcd.district==value" value="{{value}}">{{value}}</option>
									</select>
								</div>
								<div class="fui-cell-info" style="padding:0.2rem;border: 1px solid #D9D9D9;">
									<select class="fui-input" style="margin-left:0" ng-model="pagedata.nowitem.pcd.street">
										<option value="" selected="selected">街道</option>
										<option ng-repeat="value in pagedata.areas[pagedata.nowitem.pcd.province][pagedata.nowitem.pcd.city][pagedata.nowitem.pcd.district]" ng-selected="pagedata.nowitem.pcd.street==value" value="{{value}}">{{value}}</option>
									</select>
								</div>
						</div>
						<div class="fui-cell">
							<div class="fui-cell-label" style="width:auto">打卡地址</div>
							<div class="fui-cell-info"><input type="text" class="fui-input" id="address" placeholder="打卡地址" ng-model="pagedata.nowitem.addressinfo.address"></div>
							<div class="fui-cell-remark" ng-click="tool.choose_location(pagedata.nowitem,'addressinfo')"><i class="icon icon-ditu"></i></div>
						</div>
						<div class="fui-cell">
						 <div class="fui-cell-label" style="width:auto">打卡坐标</div>
						</div>
						 <div class="fui-cell">
							 <div class="fui-cell-info">
								<input type="text" ng-model="pagedata.nowitem.addressinfo.lat_lng.lng" placeholder="经度"  class="form-control"/>
							 </div>
							 <div class="fui-cell-info" style="margin-left:0.5rem">
								<input type="text" ng-model="pagedata.nowitem.addressinfo.lat_lng.lat" placeholder="纬度"  class="form-control"/>
							 </div>
							 <div class="fui-cell-remark noremark" style="margin-left:0.5rem">
								<a ng-click="tool.choose_location(pagedata.nowitem.addressinfo,'lat_lng','lat_lng')" class="btn btn-default btn-default-o btn-sm" type="button">选择坐标</a>
							 </div>
						 </div>
					</div>
			</div>
			<div class="modal-footer">
				<div ng-click="pagedata.showupinfo=false;post(pagedata.nowitem,'/merch.gong/upinfo/')" class="mod-check" style="width: 100%; margin: 0;">提交设置</div>
			</div>
		</div>
	</div>
</div>
<script>
scope.tool.get_list('jy_51job/merch.gong/list/',true);
scope.pagedata.scroll_bottom=function(){
	scope.tool.get_list('jy_51job/merch.gong/list/');
}
scope.pagedata.toxieyi=function(item){
	scope.get('/gong/getxieyi/gongid='+item.id,function(res){
		scope.pagedata.nowitem=item
		scope.pagedata.show_xieyi=true;
		scope.pagedata.xieyi=res.xieyi;
		scope.$evalAsync();
	});
}
scope.pagedata.tohetong=function(item){
	scope.get('/gong/gethetong/gongid='+item.id,function(res){
		scope.pagedata.nowitem=item
		scope.pagedata.show_hetong=true;
		scope.pagedata.hetong=res.hetong;
		scope.$evalAsync();
	});
}
scope.pagedata.getprovince=function(){
	scope.get('core/member.set/getprovince/',function(res){
		scope.pagedata.areas=res.province;
		scope.$evalAsync();
	});
}
scope.pagedata.getprovince();
</script>